import time
def buble(mas):
    swap = True
    while swap:
      swap = False
      for i in range(len(mas) - 1):
          if int(mas[i]) > int(mas[i+1]):
            mas[i], mas[i+1] = mas[i+1], mas[i]
            swap = True  
    return mas

def time_s(mas):
  t_start = time.time()
  x = buble(mas)
  t_finish = time.time()
  print("time - ", round((t_finish - t_start)) * 1000, ' мил. сек.')

f  = open('m3_shuffle.txt')
f1 = open('m1_sorted.txt')
f2 = open('m2_reverse.txt')
ar = f.readlines()
ar1 = f1.readlines()
ar2 = f2.readlines()

time_s(ar)
time_s(ar1)
time_s(ar2)
